package com.lemner.ke.base;

import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

/**
 * Created by wubihang on 2018/9/12.
 * 全屏Activity基类
 */

public abstract class PlayBaseActivity extends AppCompatActivity implements View.OnClickListener {

    /**
     * 加载布局
     */
    abstract public @LayoutRes
    int getLayoutFile();

    /**
     * 初始化控件(findViewById)
     */
    abstract public void initView();

    /**
     * 初始化事件(setEvent)
     */
    abstract public void initEvent();

    /**
     * 初始化事件(setEvent)
     */
    abstract public void initData();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.getWindow().setFlags(
                WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(getLayoutFile());
        initView();
        initEvent();
        initData();
    }
}
